<?php
class Container_OnlyRead implements Container_OnlyRead_Interface {

    protected $_arContainer = array ();


    public function __construct($arContainer = array()) {
        $this->_arContainer = $arContainer;
    }


    public function get ($strKey) {
        if (!key_exists($strKey, $this->_arContainer)) {
            throw new Exception('Element not found in container. Key: '.$strKey);
        }
        return $this->_arContainer[$strKey];
    }


    public function isExists($strKey) {
        return isset($this->_arContainer[$strKey]);
    }


    public function equal($strKey, $mixValue) {
        if (!$this->isExists($strKey)) {
            return false;
        }

        if ($this->_arContainer[$strKey] == $mixValue) {
            return true;
        }

        return false;
    }


    public function isEmpty() {
        return empty($this->_arContainer);
    }


    public function getAsArray () {
        return $this->_arContainer;
    }
}